//这个模块主要获取的是参加考试的数据的模块
import request from '@/utils/request'

// 考生放弃考试
// leaveExam
// HttpServletRequest request, String examId
export const leaveExam = (examId) => request({
    url: '/exam/exam/leaveExam',
    method: 'delete',
    params:{examId},
});

// 学生查询与自己相关的考试
// getStudentExam
// HttpServletRequest request, @RequestBody Exam exam, long current, long limit, int status
export const getStudentExam = (exam,current,limit,status) => request({
    url: '/exam/exam/getStudentExam',
    method: 'post',
    params:{current,limit,status},
    data:exam,
});

// 考生参加考试初次拿到试卷
// takeOneExamFirst
// String paperId
export const takeOneExamFirst = (paperId) => request({
    url: '/question/paper/takeOneExamFirst',
    method: 'post',
    params:{paperId},
});

//获取题型分类数据接口
export const reqGetTypeList = ()=>request({
    url:'/question/attribute/getTypeMap',
    method:'get',
});

// 考生参加考试拿到试卷试题,考虑考一半中途退场要返回之前已经填写的答案,我只想用这个
// takeOneExam
// String paperId, HttpServletRequest request
export const takeOneExam = (paperId) => request({
    url: '/question/paper/takeOneExam',
    method: 'post',
    params:{paperId},
});

// 提交试卷
// sendPaperQuestionAnswer
// HttpServletRequest request,String examId,@RequestBody Answer answer
export const sendPaperQuestionAnswer = (examId,answer) => request({
    url: '/paperSubmit/sendPaperQuestionAnswer',
    method: 'post',
    params:{examId},
    data:answer,
});

// 更新学生参加考试的所有关联信息学生端,这里主要是改变考试状态-1,0,1
// updateExamStudentConnectionFromStu
// @RequestBody StudentConnection studentConnection, HttpServletRequest request
export const updateExamStudentConnectionFromStu = (studentConnection) => request({
    url: '/exam/exam/updateExamStudentConnectionFromStu',
    method: 'post',
    data:studentConnection,
});

// 获取学生参加考试的所有关联信息，学生端
// getExamStudentConnection
// String examId, HttpServletRequest request
export const getExamStudentConnection = (examId) => request({
    url: '/exam/exam/getExamStudentConnection',
    method: 'get',
    params:{examId},
});